home *** CD-ROM | disk | FTP | other *** search
/ Aminet 25 / Aminet 25 (1998)(GTI - Schatztruhe)[!][Jun 1998].iso / Aminet / comm / tcp / PowerWEB.lha / PowerWEB / Install_PowerWEB < prev    next >
Encoding:
Text File  |  1998-03-16  |  6.0 KB  |  197 lines

  1. ; Installation script for PowerWEB
  2. ; by Lars Holm
  3.  
  4. (transcript "On installing PowerWEB...")
  5.  
  6. (if (exists "AmiTCP:" (noreq))
  7.     (set defc 1)
  8.     (set defc 0)
  9. )
  10.  
  11. (set inst
  12.     (askchoice
  13.         (prompt "Select which TCP/IP-stack to install for")
  14.         (help "Short: Which package do you use to connect to internet with?")
  15.         (choices "Miami"
  16.                  "AmiTCP"
  17.         )
  18.         (default defc)
  19.     )
  20. )
  21.  
  22. (if inst
  23.     (
  24.         ; make sure "rx" is available
  25.         (if (not (exists "sys:rexxc/rx"))
  26.             (abort "This installer script needs to use the ARexx utility rx.\n\nPlease make sure the rx utility is installed in sys:rexxc and try to install again."))
  27.  
  28.         ; make sure we have the library that EditTextFile.rexx needs
  29.         (if (not (exists "libs:rexxsupport.library"))
  30.             (abort "This installer script needs rexxsupport.library in LIBS: to run.\n\nPlease install this library and then run this Installer script again."))
  31.  
  32.         ; try and make sure ARexx is running 
  33.         (run "rexxmast" (safe))
  34.     )
  35. )
  36.  
  37. ; if PowerWEB is already in /serv, probably they've already installed before
  38. (set DefaultUpdate (exists "PowerWEB:PowerWEB" (noreq)))
  39.  
  40. (if (= DefaultUpdate 1)
  41.  
  42.   (if (askbool (Prompt "PowerWEB has been detected on your harddrive.\n\n"
  43.                      "Do you wish do upgrade it?")
  44.  
  45.         (help     "Updating current PowerWEB to a"
  46.               "newer one is recommended!\n\n")
  47.     )
  48.        (
  49.        (Set #PowerWEB "PowerWEB:")
  50.        (copyfiles
  51.         (prompt (cat "Copying PowerWEB executable to " PowerWEB))
  52.         (help @copyfiles-help)
  53.         (source "")
  54.         (infos)
  55.         (pattern "PowerWEB")
  56.         (dest "PowerWEB:")
  57.        )
  58.  
  59.        (copyfiles
  60.         (prompt (cat "Copying CGI-Manager to %s" PowerWEB) )
  61.         (help @copyfiles-help)
  62.         (source "")
  63.         (infos)
  64.         (pattern "CGI-Bin")
  65.         (dest "PowerWEB:")
  66.       )
  67.  
  68.    (exit)
  69.  
  70.    )
  71.   (exit)
  72.  )
  73.     )
  74.     (
  75.  
  76. (set PowerWEB
  77.     (askdir
  78.         (prompt "What directory would you like to put the PowerWEB executable and related files in?\n(no directory will be created)")
  79.         (help @askdir-help)
  80.         (default (select inst "Miami:" "AmiTCP:bin") )
  81.     )
  82. )
  83.  
  84. ;(set @default-dest PowerWEB)
  85.  
  86. ; Copy PowerWEB to the bin and serv directories 
  87. (copyfiles
  88.     (prompt (cat "Copying PowerWEB executable to " PowerWEB))
  89.     (help @copyfiles-help)
  90.     (source "")
  91.     (infos)
  92.     (pattern "PowerWEB")
  93.     (dest PowerWEB)
  94. )
  95.  
  96. (set #adding-PowerWEB
  97.    (cat "The following line will be added to the "
  98.    "file 's:user-startup': \n"
  99.    "'Assign PowerWEB:<path>:PowerWEB'\n"
  100.    )
  101. )
  102.  
  103. ;user-startup
  104. ;the installer creates a user-startup if it doesn't already exist
  105. ;dont ask user
  106.  
  107.  ;Add assign to user-startup
  108.  
  109.       (startup "PowerWEB"
  110.          (command 
  111.             (cat "Assign PowerWEB: \"" (tackon PowerWEB "") "\"")
  112.          )
  113.          (prompt #adding-PowerWEB)
  114.          (help #generic-help @startup-help)
  115.       )
  116.  
  117. (makeassign ("PowerWEB") (tackon PowerWEB "") )
  118.  
  119. (copyfiles
  120.     (prompt (cat "Copying CGI-Manager to %s" PowerWEB) )
  121.     (help @copyfiles-help)
  122.     (source "")
  123.     (infos)
  124.     (pattern "CGI-Bin")
  125.     (dest PowerWEB)
  126. )
  127.  
  128. (copyfiles
  129.     (prompt (cat "Basic HTML file to %s" PowerWEB) )
  130.     (help @copyfiles-help)
  131.     (source "")
  132.     (infos)
  133.     (pattern "HTML")
  134.     (dest PowerWEB)
  135. )
  136.  
  137. ; If we're doing a first-time install, update the user's AmiTCP config files
  138. (if (= 0 WebUpdate)    
  139.     (if inst
  140.         (
  141.             (delete "t:edit_text_succeeded")
  142.             (set ARexxRunString (cat "sys:rexxc/rx EditTextFile.rexx amitcp:db/services HTTP HTTP^^^^^^^^80/tcp"))
  143.             (run
  144.                 (ARexxRunString)
  145.                 (prompt "If you plan to be running PowerWEB in conjunction with AmiTCP, the line:\n\nPowerWEB        2956/tcp\n\nneeds to be present in your amitcp:db/services file.  Do you wish me to update the file?  (Note:  PowerWEB will not receive connections if this line is not precisely as shown above!)")
  146.                 (help "The inclusion of this line into amitcp:db/services is done by an ARexx script which is smart enough to correctly edit previous installations.  Also it will make a backup (to amitcp:db/services.bak) before writing.")
  147.                 (confirm)
  148.             )
  149.             (if (not (exists "t:edit_text_succeeded"))
  150.                (message "For some reason, the config file editing script (EditText.rexx) could not complete successfully.  You'll need to edit your amitcp:db/services file yourself.  Look in the 'Installation' section of the PowerWEB Guide for instructions."))
  151.                         
  152.             (delete "t:edit_text_succeeded")
  153.             (set ARexxRunString (cat "sys:rexxc/rx EditTextFile.rexx amitcp:db/inetd.conf PowerWEB PowerWEB^^^^^^^^stream^^tcp^^^^^nowait^^root^^^^amitcp:serv/PowerWEB"))
  154.             (run
  155.                 (ARexxRunString)
  156.                 (prompt "\nAlso, the line:\n\nPowerWEB    stream      tcp nowait root    amitcp:serv/PowerWEB\n\nneeds to be present in your amitcp:db/inetd.conf file.  Do you wish me to update that file?\n(Note:  PowerWEB will not receive connections if this line is not precisely as shown above!)")
  157.                 (help "The inclusion of this line into amitcp:db/inetd.conf is done by an ARexx script which is smart enough to correctly edit previous installations.  Also it will make a backup (to amitcp:db/inetd.conf.bak) before writing.")
  158.                 (confirm)
  159.             )
  160.             (if (not (exists "t:edit_text_succeeded"))
  161.                (message "For some reason, the config file editing script (EditText.rexx) could not complete successfully.  You'll need to edit your amitcp:db/inetd.conf file yourself.  Look in the 'Installation' section of the PowerWEB Guide for instructions."))
  162.         )
  163.  
  164.         (
  165.             ; Create the textfile with a pointer to PowerWEB
  166.             (textfile
  167.                (dest "t:dbtemp")
  168.                (append
  169.                   "ADD services http 80/tcp\n"
  170.                   ("ADD inetd PowerWEB stream tcp nowait root %s\n" (tackon PowerWEB "PowerWEB") )
  171.                )
  172.             )
  173.  
  174.             ; Add the lines to envarc:MiamiChangeDB (i.e. don't overwrite! Other programs
  175.             ; may have their lines there too)
  176.             (run "type t:dbtemp >>envarc:MiamiChangeDB")
  177.  
  178.             ; If Miami shoule be running... why not make it read the new settings?
  179.             (run "SYS:Rexxc/RX \"ADDRESS MIAMI.1;changedb\"")
  180.  
  181.             ; Clean up
  182.             (delete "t:dbtemp")
  183.         )    
  184.  
  185.     )
  186.    )
  187.  
  188. )
  189.  
  190.  
  191.  
  192.  
  193. (if inst
  194.     (message "\n\nPowerWEB is now installed.\nRe-start AmiTCP and try it out!")
  195.     (message "\n\nPowerWEB is now installed.\nMiami has been notified about the changes!")
  196. )
  197.